package com.gt.admin.controller;

import com.gt.common.core.controller.BaseController;
import com.gt.common.core.domain.AjaxResult;
import com.gt.common.core.page.TableDataInfo;
import com.gt.admin.domain.vo.CheckVO;
import com.gt.admin.service.ICheckService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "sc-检查")
@RestController
@RequestMapping("/check")
public class CheckController extends BaseController {
    @Autowired
    private ICheckService checkService;


    /** 搜索检查列表 */
    @ApiOperation("搜索检查列表")
    @GetMapping
    public TableDataInfo list(CheckVO checkVO){
        startPage();
        List<CheckVO> list = checkService.list(checkVO);
        return getDataTable(list);
    }

    /** 分析图表 */
    @ApiOperation("分析图表")
    @GetMapping("/graph")
    public AjaxResult analyse(CheckVO checkVO){
        return AjaxResult.success(checkService.analyse(checkVO));
    }
}
